package com.itheima.a09InnerClassDemo6;

public class Test2 {
    public static void main(String[] args) {
        // 接口多态
        Swim s = new Swim(){
            @Override
            public void swim() {
                System.out.println("重写swim");
            }
        };
        // 编译看左边，运行看右边
        s.swim();

        new Swim(){
            @Override
            public void swim() {
                System.out.println("重写swim2");
            }
        }.swim();
    }
}
